<?php
 defined('_JEXEC') or die('Restricted access');
 jimport( 'joomla.application.component.controller' );
 class ThoikhoabieuController extends JController{
 	function display(){
 		 	$document =& JFactory::getDocument();
 		 	$viewType = $document->getType();
 		 	$viewName ='TKB';
 		 	$view = &$this->getView($viewName, $viewType);
 		 	$view->setLayout('default');
 		 	$view->display();
	}
	function tkbmonhoc(){
				//Get document
		    $document =& JFactory::getDocument();
		 	 //get request of view name with default is 'all'  
		 	 //index.php?option=com_thoikhoabieu&view=tkbmonhoc
		   //	$viewName	= JRequest::getVar('view', 'thoi khoa bieu', 'default', 'cmd');
			$viewName	= 'tkbmonhoc';
			$layout		= 'default';
			
		    $viewType = $document->getType();
		    //Get view with view type
		    $view = &$this->getView($viewName, $viewType);
		    //dung chung models TKB
		    $model	= &$this->getModel('TKB');
		    //$model	= &$this->getModel('$viewName');
		  
		    if (!JError::isError( $model )) {
		    	//set model vao trong view
		     $view->setModel( $model, true );
		    }
		    //set layout is default
		    $view->setLayout($layout);
		    //Call display() of ReviewsViewAll class in view.html.php
		    $view->display();
		    //These code above in display can be replaced by one line code.
		  	
		  
	}
	function tkblop(){
		$document =& JFactory::getDocument();
		$viewName='tkblop';
		$layout='default';
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		//$model=&$this->getModel('TKB');
		//if(!JError::isError($model)){
		//	$view->setModel($model,true);
		//}
		$view->setLayout($layout);
		$view->display();
	
	}
	function callbacknganh(){
		$document =& JFactory::getDocument();
		$viewName='listnganh';
		$layout='default';
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		$model=&$this->getModel('TKB');
		if(!JError::isError($model)){
			$view->setModel($model,true);
		}
		$view->setLayout($layout);
		$view->display();
	}
	function tkblop_detail(){
		$document=&JFactory::getDocument();
		$viewName="tkblopdetail";
		$layout='default';
		$viewType=$document->getType();
		$view=&$this->getView($viewName,$viewType);
		$model=&$this->getModel('TKB');
		if(!JError::isError($model)){
			$view->setModel($model,true);	
		}
		$view->setLayout($layout);
		$view->display();
	}

	
 }
